import request from '@/utils/request'

const url = 'souvenir/order/'

export const addOrder = (data) => {
  return request({
    url: url + 'addOrder',
    method: 'post',
    data
  })
}

export const updateOrder = (data) => {
  return request({
    url: url + 'updateOrder',
    method: 'put',
    data
  })
}

export const deleteOrder = (orderId) => {
  return request({
    url: url + 'deleteOrder' + '/' + orderId,
    method: 'delete'
  })
}

export const getOrderWithPage = (data) => {
  return request({
    url: url + 'getOrderWithPage',
    method: 'post',
    data
  })
}

export const getOrderById = (orderId) => {
  return request({
    url: url + 'getOrderById' + '/' + orderId,
    method: 'get'
  })
}

export const getSalesPerYear = (params) => {
  return request({
    url: url + 'getSalesPerYear',
    method: 'get',
    params
  })
}

export const getSalesPerMonth = (params) => {
  return request({
    url: url + 'getSalesPerMonth',
    method: 'get',
    params
  })
}

export const getSalesWithCategory = () => {
  return request({
    url: url + 'getSalesWithCategory',
    method: 'get'
  })
}
